class Calculator{

public static int[][] generateRandomIntMatrix(int row, int col) {
	int[][] matrix = new int[row][col];
	for(int i=0; i<matrix.length; i++) {
		for(int j=0; j<matrix[0].length;j++) {
			matrix[i][j] = (int)(Math.random()*1000);
		}
	
	}
	return matrix;
}

//Printing multidimensional integer array

public static void printIntMultiDimensionalArray(int[][] array){

for(int i=0;i<array.length;i++){
	for(int j=0; j<array[i].length;j++){	
		System.out.print(array[1][j] + " ");
	}
System.out.println();
}
}

// Sum of all the elements in Multidimensional Array

public static int sumOfAllElements(int[][] matrix) {
	
int total=0;
for(int i=0;i<matrix.length;i++){
	for(int j=0;j<matrix[i].length;j++){
	total += matrix[i][j];
	}
	
}
		return total;
}

// Sum of Row the elements in Multidimensional Array
public static int sumOfRowElements(int[][] matrix) {
	

for(int i=0;i<matrix[i].length;i++){
	int totalOfThisRow=0;
	for(int j=0;j<matrix.length;j++){
	totalOfThisRow += matrix[i][j];
	
	}
	return totalOfThisRow;
}
	
}
}